Skip to content

Conversation

@SwayamInSync
Copy link
Member

Copilot Summary

This pull request adds support for the heaviside function to the QuadPrecision dtype, implementing both the core logic and comprehensive tests. The implementation follows NumPy's behavior, including correct handling of NaN propagation and broadcasting. Documentation and release tracking have also been updated to reflect this new feature.

Implementation of heaviside function:

  • Added quad_heaviside and ld_heaviside functions implementing the Heaviside step logic for quad and long double types, with correct NaN propagation and handling for all edge cases. [1] [2]
  • Registered the new heaviside ufunc for QuadPrecision by updating the binary ops initialization.

Testing:

  • Added extensive parameterized tests for np.heaviside with QuadPrecision, covering basic, edge, special, and broadcasting cases to ensure correctness and compatibility with NumPy's semantics.

Documentation and tracking:

  • Updated the release tracker documentation to mark heaviside as implemented and tested for QuadPrecision.

Copy link
Contributor

@juntyr juntyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SwayamInSync
Copy link
Member Author

Merging this in!

@SwayamInSync SwayamInSync merged commit 6417cd8 into numpy:main Oct 17, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants